from pydantic import BaseModel, Field


class ImageSchema(BaseModel):
    name: str
    file: str


class ShopInSchema(BaseModel):
    name: str = Field(description="店铺名称")
    address: str = Field(description="店铺地址")
    phone: str = Field(description="客服电话")
    image: ImageSchema | None


class ShopOutSchema(BaseModel):
    id: int = Field(default=None, description="自增ID")
    name: str = Field(default=None, description="店铺名称")
    address: str = Field(default=None, description="店铺地址")
    phone: str = Field(default=None, description="客服电话")
    image: ImageSchema | None

    class Config:
        from_attributes = True
